// PersistentSortVisitor.cpp: implementation of the PersistentSortVisitor class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "PersistentSortVisitor.h"
#include "Volume.h"
#include "AssocCommon.h"
#include "Part.h"
#include "SupportHanger.h"
#include "Joint.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
/*
namespace PersistentObjectOperation
{
	PersistentSortVisitor::PersistentSortVisitor()
	{
		
	}
	
	PersistentSortVisitor::~PersistentSortVisitor()
	{
		
	}
	
	BOOL PersistentSortVisitor::Visit(Volume* pVolume)
	{
		ASSERT(pVolume);
		BOOL bResult = FALSE;
/*		GraphicModelSpaceManager& GMSM = pVolume->GetGMSManager();
		GraphicModelSpaceManager::Iterator* pIterator = GMSM.NewIterator();
		ASSERT(pIterator);
		for(pIterator->Begin(); !pIterator->End(); pIterator->Next())
		{
			GraphicModelSpace* pGMS = pIterator->Get();
			ASSERT(pGMS);
			bResult = pGMS->Save();
			ASSERT(bResult);
		}*/

/*		PersistentObjectVisitor* pVisitor = GetVisit(pVolume);
		if(pVisitor != NULL)
			return pVisitor->Visit(pVolume);
		return TRUE;
	}
	
	BOOL PersistentSortVisitor::Visit(Part* pPart)
	{
		ASSERT(pPart);
		PersistentObjectVisitor* pVisitor = GetVisit(pPart);
		if(pVisitor != NULL)
			return pVisitor->Visit(pPart);
		return TRUE;
	}
	
	BOOL PersistentSortVisitor::Visit(SupportHanger* pSH)
	{
		ASSERT(pSH);
		PersistentObjectVisitor* pVisitor = GetVisit(pSH);
		if(pVisitor != NULL)
			return pVisitor->Visit(pSH);
		return TRUE;
	}
	
	BOOL PersistentSortVisitor::Visit(Joint* pJoint)
	{
		ASSERT(pJoint);
		PersistentObjectVisitor* pVisitor = GetVisit(pJoint);
		if(pVisitor != NULL)
			return pVisitor->Visit(pJoint);
		return TRUE;
	}

	PersistentObjectVisitor* PersistentSortVisitor::GetVisit(PersistentObject* pObject)
	{
		ASSERT(pObject);

		if(pObject->IsCreateState())
		{
			return &m_Create;
		}
		else if(pObject->IsModifyState())
		{
			return &m_Modify;
		}
		else if(pObject->IsSaveDeleteState())
		{
			return &m_SaveDelete;
		}
		else
		{
			return NULL;
		}

	}
}*/